home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / kms20src.lha / KMSXPR / xproto.h < prev   
C/C++ Source or Header  |  1994-02-19  |  6KB  |  157 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                 STRPTR   xpr_filename;      /* File name(s)             */
  11.                   LONG (*xpr_fopen)();      /* Open file                */
  12.                   LONG (*xpr_fclose)();     /* Close file               */
  13.                   LONG (*xpr_fread)();      /* Get UBYTE from file       */
  14.                   LONG (*xpr_fwrite)();     /* Put string to file       */
  15.                  ULONG (*xpr_sread)();      /* Get UBYTE from serial     */
  16.                   LONG (*xpr_swrite)();     /* Put string to serial     */
  17.                   LONG (*xpr_sflush)();     /* Flush serial input buffer*/
  18.                   LONG (*xpr_update)();     /* Print stuff              */
  19.                   LONG (*xpr_chkabort)();   /* Check for abort          */
  20.                   LONG (*xpr_chkmisc)();    /* Check misc. stuff        */
  21.                   LONG (*xpr_gets)();       /* Get string interactively */
  22.                   LONG (*xpr_setserial)();  /* Set and Get serial info  */
  23.                   LONG (*xpr_ffirst)();     /* Find first file name     */
  24.                   LONG (*xpr_fnext)();      /* Find next file name      */
  25.                   LONG (*xpr_finfo)();      /* Return file info         */
  26.                   LONG (*xpr_fseek)();      /* Seek in a file           */
  27.                   LONG   xpr_extension;     /* Number of extensions     */
  28.                   LONG  *xpr_data;          /* Initialized by Setup.    */
  29.                  ULONG (*xpr_options)();    /* Multiple XPR options.    */
  30.                   LONG (*xpr_unlink)();     /* Delete a file.           */
  31.                   LONG (*xpr_squery)();     /* Query serial device      */
  32.                   LONG (*xpr_getptr)();     /* Get various host ptrs    */
  33.               };
  34.  
  35. /*
  36. *   Number of defined extensions
  37. */
  38. #define XPR_EXTENSION 4L
  39.  
  40. /*
  41. *   The functions
  42. */
  43.  
  44. LONG XProtocolCleanup(struct XPR_IO *);
  45. LONG XProtocolSetup(struct XPR_IO *);
  46. LONG XProtocolSend(struct XPR_IO *);
  47. LONG XProtocolReceive(struct XPR_IO *);
  48. LONG XProtocolHostMon(struct XPR_IO *,APTR,LONG,LONG);
  49. LONG XProtocolUserMon(struct XPR_IO *,APTR,LONG,LONG);
  50.  
  51. #ifdef LATTICE
  52.  
  53. /* Pragmas for SAS/Lattice-C V5.0 */
  54.  
  55. #pragma libcall XProtocolBase XProtocolCleanup 1e 801
  56. #pragma libcall XProtocolBase XProtocolSetup 24 801
  57. #pragma libcall XProtocolBase XProtocolSend 2a 801
  58. #pragma libcall XProtocolBase XProtocolReceive 30 801
  59. #pragma libcall XProtocolBase XProtocolHostMon 36 109804
  60. #pragma libcall XProtocolBase XProtocolUserMon 3c 109804
  61.  
  62. #endif    /* LATTICE */
  63.  
  64. #ifdef AZTEC_C
  65.  
  66. /* Pragmas for Manx Aztec-C V5.0 */
  67.  
  68. #pragma amicall(XProtocolBase, 0x1e, XProtocolCleanup(a0))
  69. #pragma amicall(XProtocolBase, 0x24, XProtocolSetup(a0))
  70. #pragma amicall(XProtocolBase, 0x2a, XProtocolSend(a0))
  71. #pragma amicall(XProtocolBase, 0x30, XProtocolReceive(a0))
  72. #pragma amicall(XProtocolBase, 0x36, XProtocolHostMon(a0,a1,d0,d1))
  73. #pragma amicall(XProtocolBase, 0x3c, XProtocolUserMon(a0,a1,d0,d1))
  74.  
  75. #endif    /* AZTEC */
  76.  
  77. /*
  78. *   Flags returned by XProtocolSetup()
  79. */
  80. #define XPRS_FAILURE    0x00000000L
  81. #define XPRS_SUCCESS    0x00000001L
  82. #define XPRS_NORECREQ   0x00000002L
  83. #define XPRS_NOSNDREQ   0x00000004L
  84. #define XPRS_HOSTMON    0x00000008L
  85. #define XPRS_USERMON    0x00000010L
  86. #define XPRS_HOSTNOWAIT 0x00000020L
  87. #define XPRS_NOUPDATE   0x00008000L    /* NEW! */
  88. #define XPRS_XPR2001    0x00010000L    /* NEW! */
  89. #define XPRS_DOUBLE     0x00020000L    /* NEW! */
  90. /*
  91. *   The update structure
  92. */
  93. struct XPR_UPDATE {     ULONG  xpru_updatemask;
  94.                         STRPTR xpru_protocol;
  95.                         STRPTR xpru_filename;
  96.                         LONG   xpru_filesize;
  97.                         STRPTR xpru_msg;
  98.                         STRPTR xpru_errormsg;
  99.                         LONG   xpru_blocks;
  100.                         LONG   xpru_blocksize;
  101.                         LONG   xpru_bytes;
  102.                         LONG   xpru_errors;
  103.                         LONG   xpru_timeouts;
  104.                         LONG   xpru_packettype;
  105.                         LONG   xpru_packetdelay;
  106.                         LONG   xpru_chardelay;
  107.                         STRPTR xpru_blockcheck;
  108.                         STRPTR xpru_expecttime;
  109.                         STRPTR xpru_elapsedtime;
  110.                         LONG   xpru_datarate;
  111.                         LONG   xpru_reserved1;
  112.                         LONG   xpru_reserved2;
  113.                         LONG   xpru_reserved3;
  114.                         LONG   xpru_reserved4;
  115.                         LONG   xpru_reserved5;
  116.                    };
  117. /*
  118. *   The possible bit values for the xpru_updatemask are:
  119. */
  120. #define XPRU_UPLOAD             0x80000000L
  121. #define XPRU_DNLOAD             0x40000000L
  122. #define XPRU_PROTOCOL           0x00000001L
  123. #define XPRU_FILENAME           0x00000002L
  124. #define XPRU_FILESIZE           0x00000004L
  125. #define XPRU_MSG                0x00000008L
  126. #define XPRU_ERRORMSG           0x00000010L
  127. #define XPRU_BLOCKS             0x00000020L
  128. #define XPRU_BLOCKSIZE          0x00000040L
  129. #define XPRU_BYTES              0x00000080L
  130. #define XPRU_ERRORS             0x00000100L
  131. #define XPRU_TIMEOUTS           0x00000200L
  132. #define XPRU_PACKETTYPE         0x00000400L
  133. #define XPRU_PACKETDELAY        0x00000800L
  134. #define XPRU_CHARDELAY          0x00001000L
  135. #define XPRU_BLOCKCHECK         0x00002000L
  136. #define XPRU_EXPECTTIME         0x00004000L
  137. #define XPRU_ELAPSEDTIME        0x00008000L
  138. #define XPRU_DATARATE           0x00010000L
  139. /*
  140. *   The xpro_option structure
  141. */
  142. struct xpr_option {
  143.    STRPTR xpro_description;      /* description of the option                  */
  144.    LONG   xpro_type;             /* type of option                             */
  145.    STRPTR xpro_value;            /* pointer to a buffer with the current value */
  146.    LONG   xpro_length;           /* buffer size                                */
  147. };
  148. /*
  149. *   Valid values for xpro_type are:
  150. */
  151. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  152. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  153. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  154. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  155. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  156. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  157.